<?php
namespace Home\Controller;
use Think\Controller;
class NewsController extends Controller {
    public function index(){
    	$this->news = M('News')->select();
        $this->banner=M('banner')->order('id')->select();
        $this->qfooter=M('qfooter')->find();
        $this->display();
    }
    public function ajax_data(){
    	$id = I('id');
    	if($info = M('News')->where("id='$id'")->find()){
    		$info = htmlspecialchars_decode($info['content']);
    		$this->ajaxReturn(V(1,$info));
    	}else{
    		$this->ajaxReturn(V(2));
    	}
    }
}